import './App.less';
import React, { Component } from 'react'
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import Position from './components/Position'
import Count from './components/Count'
import Person from './components/Person'

import store  from './redux/store'


export default class App extends Component {
  constructor(props) {
    super(props);
    //subscribe当store中数据发生变化就会更新数据
    store.subscribe(() => {
      this.setState({})
    })
  }
  render() {
    return (
      <div className="App">
        <BrowserRouter>
          <Switch>
            <Route path='/count' component={Count}></Route>
            <Route path='/person' component={Person}></Route>
            <Route path='/' component={Position}></Route>
          </Switch>
        </BrowserRouter>
      </div>
    )
  }
}

